package org.erepublik.company;

import java.util.HashMap;

/**
 * Klasa reprezentuja stawki podatkowe w pojedynczym kraju
 *
 * @author Kacper Gorski 'Railman' railman85@gmail.com
 */
public class Taxes {

	private ECountry country=null;
	private HashMap<EProductType, Tax> taxes = new HashMap<EProductType, Tax>();
	
	public void setCountry(ECountry country) {
		this.country = country;
	}
	public ECountry getCountry() {
		return country;
	}

    public void setTaxes(EProductType productType, Tax foodTax) {
        taxes.put(productType, foodTax);
    }
    
    public double getVat(EProductType productType) {
        if (taxes.get(productType)==null || productType.isRaw())
            return 0;
        else 
            return taxes.get(productType).getVat()/100.0d;
    }
    public double getImportTax(EProductType productType) {
        if (taxes.get(productType)==null)
            return 0;
        else 
            return taxes.get(productType).getImportTax()/100.0d;
    }
    public double getIncomeTax(EProductType productType) {
        if (taxes.get(productType)==null)
            return 0;
        else 
            return taxes.get(productType).getIncomeTax()/100.0d;
    }

	
}
